import Alert from "./Alert.vue";
import Vue from 'vue';

//Vue提供extend函数，返回构造函数
let AlertConstructor = Vue.extend(Alert);

let alert = (option)=>{
  let  instance = new AlertConstructor();
  instance.$mount(document.createElement("div"));
  document.body.appendChild(instance.$el);
  instance.show = true;
  console.log(option);
  if(option.title){
    instance.title = option.title;
  }
  if(option.content){
    instance.content = option.content
  }
  if(option.confirm){
    instance.confirm = option.confirm
  }
  
  // return instance;
}

export default alert;
